Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vswhere: new recipe #25201

Closed
wants to merge 1 commit into from
Closed

vswhere: new recipe #25201

wants to merge 1 commit into from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Sep 10, 2024

Summary

Changes to recipe: vswhere/3.1.7

Motivation

CLI tool to locate Visual Studio 2017 and newer installations. https://github.com/microsoft/vswhere
Packaging status

Used by NSS to configure MSVC support in #19262: https://github.com/nss-dev/nss/blob/NSS_3_104_RTM/coreconf/msvc.sh#L47-L48

While the dependency in NSS could probably be patched around, the tool is simple to package and possibly useful in other contexts as well.

Details


@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 1 (31bbbd8f299d2de6cac6df4a22290d185b3af8aa):

  • vswhere/3.1.7:
    All packages built successfully! (All logs)

Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 1 (31bbbd8f299d2de6cac6df4a22290d185b3af8aa):

  • vswhere/3.1.7:
    All packages built successfully! (All logs)

@Nekto89
Copy link
Contributor

Nekto89 commented Sep 10, 2024

Is it possible to not have this tool at all on machines with VS installed?

vswhere is included with the installer as of Visual Studio 2017 version 15.2 and later, and can be found at the following location: %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe

@valgur
Copy link
Contributor Author

valgur commented Sep 10, 2024

Is it possible to not have this tool at all on machines with VS installed?

vswhere is included with the installer as of Visual Studio 2017 version 15.2 and later, and can be found at the following location: %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe

Ah, good point. I missed that fact. It was not found on PATH when building NSS, though, despite VCVars being activated. Might need additional setup.

@valgur
Copy link
Contributor Author

valgur commented Oct 10, 2024

I would still add it as a CCI package. vswhere is guaranteed to be installed only on VS 2017 / 15.2. It's normally not found on PATH, though. The recipes will need to include env.append_path("PATH", r"C:\Program Files (x86)\Microsoft Visual Studio\Installer") for it to be found. And event then it feels a bit fragile.

See also: https://github.com/Microsoft/vswhere/wiki/Installing

@jcar87
Copy link
Contributor

jcar87 commented Jan 9, 2025

Agreeing with @Nekto89 here - note that Conan 2 supports VS2017 and newer - and that vswhere is unconditionally installed by the installer in that location (irrespective of where visual studio itself is installed) - don't think it's worth it.

I'm not aware of any installation process of vswhere where it ends up in PATH - so it may be worth checking with the nss developers, https://github.com/nss-dev/nss/blob/NSS_3_104_RTM/coreconf/msvc.sh#L47-L48 - i suspect this should refer to the file with its full path

On the other hand, looking at the NSS scripts - it is using vswhere to manually set up the variables that the vcvars script would otherwise do - this could cause two issues:

  • if vcvars is already "loaded" (that is, LIB, INCLUDE vars is already defined) - these variables will either be overwritten or appended/prepended
  • it picks up the "latest" that vswhere finds - instead of the one specified by the user in the Conan profile.

It may be safest to let Conan bring up the vcvars, and simply define GYP_MSVS_VERSION, VSPATH and GYP_MSVS_OVERRIDE_PATH in the recipe - and don't let the nss script invoke vswhere at all

@jcar87 jcar87 closed this Jan 9, 2025
@valgur
Copy link
Contributor Author

valgur commented Jan 9, 2025

Sounds reasonable. I'll look into getting rid of the vswhere dep in nss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants